<template>
  <view>
    <swiper
      :indicator-dots="true"
      :autoplay="true"
      :interval="3000"
      :duration="1000"
      :circular="true"
    >
      <!-- 循环渲染轮播图的 item 项 -->
      <swiper-item v-for="item in banners" :key="item.id">
        <view class="swiper-item">
          <navigator
            url="/pages/goods_detail/index?goods_id=129"
            open-type="navigate"
          >
            
          </navigator>
          <!-- 动态绑定图片的 src 属性 -->
          <image class="img" :src="item.image_src"></image>
        </view>
      </swiper-item>
    </swiper>
  </view>
</template>

<script>
export default {
  // 2. 子组件，定义`props`
  props: {
    banners: Array,
    height: String,
  },
};
</script>

<style scoped>
.swiper {
  height: 330rpx;
}
img {
  width: 100%;
  height: 100%;
}
</style>
